package dazuoye;

import java.util.Objects;

public class ExamScore {
	
    private String code;
	private String subject;
    private int score;
    private String name;
    
    public ExamScore(String initialCode,String initialSubject,int initialScore,String initialName){
        this.code=initialCode;
        this.subject=initialSubject;
        this.score=initialScore;
        this.name=initialName;      
    }
    public String getCode() {
 		return code;
 	}
 	
 	public String getSubject() {
 		return subject;
 	}
 	
 	public int getScore() {
 		return score;
 	}
 	
 	public String getName() {
 		return name;
 	}
 	
 	
 	
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ExamScore other = (ExamScore) obj;
		return Objects.equals(code, other.code) && Objects.equals(name, other.name) && score == other.score
				&& Objects.equals(subject, other.subject);
	}
 	
	public String toString() {
		return getCode()+"_"+getName()+"_"+getSubject()+"_"+getScore();
	}
}
